package cn.wolfcode.rbac.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class Department extends BaseDomain {
    private String name;
    private String sn;

    //写一个JSON方法GET 来获取LIST.FTL中提交过来的表单数据
    /*public String getJson(){
        return "{\"name\":\"dddd\"}";
    }*/
    //使用fastJson来生成
    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        return JSON.toJSONString(map);
    }
    public Department(Long id, String name, String sn) {
        super(id);
        this.name = name;
        this.sn = sn;
    }

    public Department() {
    }

    @Override
    public String toString() {
        return "Department{" +
                "name='" + name + '\'' +
                ", sn='" + sn + '\'' +
                ", id=" + id +
                '}';
    }
}
